package org.devgframwork.datasync.admin.rabbit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.devgframwork.datasync.admin.rabbit.dao.JdbcConfigMapper;
import org.devgframwork.datasync.core.entity.JdbcConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JdbcConfigService extends ServiceImpl<JdbcConfigMapper, JdbcConfig> {

  @Autowired
  private JdbcConfigMapper jdbcConfigMapper;

  public IPage getJdbcPage(Page page, JdbcConfig jdbcConfig) {
    QueryWrapper<JdbcConfig> queryWrapper = new QueryWrapper();
    return jdbcConfigMapper.selectPage(page, queryWrapper);
  }

  public List<JdbcConfig> getJdbcConfigList() {
    QueryWrapper<JdbcConfig> queryWrapper = new QueryWrapper();
    queryWrapper.eq("IS_DELETE", 0);
    return jdbcConfigMapper.selectList(queryWrapper);
  }
}
